package Operation;

import Book.BookList;

import java.util.Scanner;

public class BorrowBook implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("请输入您要借的书的名字");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        for(int i = 0; i < bookList.getUsedBookList();i ++){
            if (name.equals(bookList.GetBook(i).getName())){
                System.out.println("您需要借的图书的信息如下");
                System.out.println(bookList.GetBook(i).toString());
                bookList.GetBook(i).setLend(true);
                return;
            }
        }
        System.out.println("*****抱歉,没找到您所需要的书*****");
    }
}
